<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Win10 X64 1904 系统调用 | 学海无涯苦作舟</title><meta name="author" content="小乾"><meta name="copyright" content="小乾"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="系统调用系统调用分为两种,一种是新款cpu提供的指令(systemcall )称之为快速调用 ,另一种是通过int2e中断提权调用(目前使用很少为了兼容老cpu). INT2E 调用int2e走ntoskrnl.exe 中的KxUnexpectedInterrupt0函数  但是我逆了发现 如果你的cpu符合快速调用环境,你的int2E就不会执行,我尝试了用windbg下了断点但是断不下来我强行再">
<meta property="og:type" content="article">
<meta property="og:title" content="Win10 X64 1904 系统调用">
<meta property="og:url" content="https://xiaoqian2000.gitee.io/blogs/2023/08/20/win10%20%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/index.html">
<meta property="og:site_name" content="学海无涯苦作舟">
<meta property="og:description" content="系统调用系统调用分为两种,一种是新款cpu提供的指令(systemcall )称之为快速调用 ,另一种是通过int2e中断提权调用(目前使用很少为了兼容老cpu). INT2E 调用int2e走ntoskrnl.exe 中的KxUnexpectedInterrupt0函数  但是我逆了发现 如果你的cpu符合快速调用环境,你的int2E就不会执行,我尝试了用windbg下了断点但是断不下来我强行再">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoqian2000.gitee.io/blogs/img/headpicture.png">
<meta property="article:published_time" content="2023-08-20T13:21:52.000Z">
<meta property="article:modified_time" content="2023-08-20T13:22:38.655Z">
<meta property="article:author" content="小乾">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoqian2000.gitee.io/blogs/img/headpicture.png"><link rel="shortcut icon" href="/blogs/img/headpicture.png"><link rel="canonical" href="https://xiaoqian2000.gitee.io/blogs/2023/08/20/win10%20%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blogs/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/blogs/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Win10 X64 1904 系统调用',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-08-20 21:22:38'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/blogs/img/headpicture.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/blogs/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blogs/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blogs/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blogs/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/blogs/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/blogs/img/wallhaven-vqqzlp_2560x1600.png')"><nav id="nav"><span id="blog-info"><a href="/blogs/" title="学海无涯苦作舟"><span class="site-name">学海无涯苦作舟</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blogs/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/blogs/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Win10 X64 1904 系统调用</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-08-20T13:21:52.000Z" title="发表于 2023-08-20 21:21:52">2023-08-20</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-08-20T13:22:38.655Z" title="更新于 2023-08-20 21:22:38">2023-08-20</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blogs/categories/windows%E5%86%85%E6%A0%B8%E7%9F%A5%E8%AF%86/">windows内核知识</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Win10 X64 1904 系统调用"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="系统调用"><a href="#系统调用" class="headerlink" title="系统调用"></a>系统调用</h1><p>系统调用分为两种,一种是新款cpu提供的指令(systemcall )称之为快速调用 ,另一种是通过int2e中断提权调用(目前使用很少为了兼容老cpu).</p>
<h2 id="INT2E-调用"><a href="#INT2E-调用" class="headerlink" title="INT2E 调用"></a>INT2E 调用</h2><p>int2e走ntoskrnl.exe 中的KxUnexpectedInterrupt0函数</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/int2e.png"></p>
<p>但是我逆了发现 如果你的cpu符合快速调用环境,你的int2E就不会执行,我尝试了用windbg下了断点但是断不下来我强行再内部下断经常会被编号为(d1)的时钟中断断下,但是跟进去发现了有个地方判断在KPRCB+3140h地方有个大小为256个指针函数(中断表)[mov     rsi, [rsi+rax*8+3140h]],rax就是中断索引号 rsi是_KPRCB,(d1)是有值的而(2e)是0.</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/%E5%BC%82%E5%B8%B8%E5%87%BD%E6%95%B0%E5%88%A4%E6%96%AD.png"></p>
<p>后面有一大段流程就没有继续逆了.</p>
<h2 id="快速调用"><a href="#快速调用" class="headerlink" title="快速调用"></a>快速调用</h2><p>32位系统走的是sysenter&#x2F;sysexit指令</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/sysenter.png"></p>
<h4 id="sysenter"><a href="#sysenter" class="headerlink" title="sysenter"></a>sysenter</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">IF in IA-32e mode</span><br><span class="line">THEN</span><br><span class="line">RSP ← IA32_SYSENTER_ESP;</span><br><span class="line">RIP ← IA32_SYSENTER_EIP;</span><br><span class="line">ELSE</span><br><span class="line">ESP ← IA32_SYSENTER_ESP[31:0];</span><br><span class="line">EIP ← IA32_SYSENTER_EIP[31:0];</span><br><span class="line">FI;</span><br><span class="line">CS.Selector ← IA32_SYSENTER_CS[15:0] AND FFFCH;</span><br><span class="line">(* Operating system provides CS; RPL forced to 0 *)</span><br><span class="line">SS.Selector ← CS.Selector + 8;</span><br></pre></td></tr></table></figure>

<h4 id="sysexit"><a href="#sysexit" class="headerlink" title="sysexit"></a>sysexit</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">IF operand size is 64-bit</span><br><span class="line">THEN (* Return to 64-bit mode *)</span><br><span class="line">RSP ← RCX;</span><br><span class="line">RIP ← RDX;</span><br><span class="line">ELSE (* Return to protected mode or compatibility mode *)</span><br><span class="line">RSP ← ECX;</span><br><span class="line">RIP ← EDX;</span><br><span class="line">FI;</span><br><span class="line">IF operand size is 64-bit (* Operating system provides CS; RPL forced to 3 *)</span><br><span class="line">THEN CS.Selector ← IA32_SYSENTER_CS[15:0] + 32;</span><br><span class="line">ELSE CS.Selector ← IA32_SYSENTER_CS[15:0] + 16;//这里加了16</span><br><span class="line">FI;</span><br><span class="line">CS.Selector ← CS.Selector OR 3; (* RPL forced to 3 *)</span><br><span class="line">SS.Selector ← CS.Selector + 8;//上面有加16</span><br></pre></td></tr></table></figure>

<h5 id="测试"><a href="#测试" class="headerlink" title="测试"></a>测试</h5><p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/ret.png"></p>
<h3 id="Syscall-64位系统"><a href="#Syscall-64位系统" class="headerlink" title="Syscall   64位系统"></a>Syscall   64位系统</h3><p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/Syscall.png"></p>
<p>syscall通过从IA32_LSTAR(MSR 地址:C0000081H) MSR加载RIP(syscall的下一条指令地址会保存到RCX).RFLAGS保存到R11寄存器,然后用IA32_FMASK MSR(MSR 地址:C0000084H)屏蔽RFLAGS的值,更具体的说是清除在IA32_FMASK MSR中设置的每一位.</p>
<p> syscall会从IA32_STAR[47:32]中加载CS和SS.</p>
<p> syscall不会保存堆栈指针(RSP)      window10 把rsp存储到_KPCR结构体中</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/saversp.bmp"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">RCX ← RIP;保存syscall下一条指令地址到RCX</span><br><span class="line">RIP ← IA32_LSTAR;RIP=IA32_LSTAR</span><br><span class="line">R11 ← RFLAGS;R11=RFLAGS</span><br><span class="line">RFLAGS ← RFLAGS AND NOT(IA32_FMASK);//根据IA32_FMASK屏蔽RFLAGS的相关位</span><br><span class="line">CS.Selector ← IA32_STAR[47:32] AND FFFCH;确保CS的RPL为0</span><br><span class="line">SS.Selector ← IA32_STAR[47:32] + 8;</span><br></pre></td></tr></table></figure>

<h3 id="sysret"><a href="#sysret" class="headerlink" title="sysret"></a>sysret</h3><ul>
<li><p>RIP&#x3D;RCX</p>
</li>
<li><p>RFLAGS&#x3D;R11</p>
</li>
<li><p>返回32位代码：CS&#x3D;CS_Selector|3 SS&#x3D;(CS_Selector+8)|3</p>
<p>返回64位代码：CS&#x3D;(CS_Selector+16)|3 SS&#x3D;(CS_Selector+8)|3</p>
</li>
<li><p>返回时不会修改(ESP or RSP)</p>
</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">IF (operand size is 64-bit)//如果是64位</span><br><span class="line">&#123;</span><br><span class="line">    THEN (* Return to 64-Bit Mode *)</span><br><span class="line">    RIP ← RCX;</span><br><span class="line">&#125;</span><br><span class="line">ELSE </span><br><span class="line">&#123;</span><br><span class="line">	(* Return to Compatibility Mode *)</span><br><span class="line">	RIP ← ECX;</span><br><span class="line">&#125;</span><br><span class="line">RFLAGS ← (R11 &amp; 3C7FD7H) | 2; (* Clear RF, VM, reserved bits; set bit 2 *)</span><br><span class="line">IF (operand size is 64-bit)</span><br><span class="line">&#123;</span><br><span class="line">	THEN CS.Selector ← IA32_STAR[63:48]+16;</span><br><span class="line">&#125;</span><br><span class="line">ELSE</span><br><span class="line">&#123;</span><br><span class="line">	CS.Selector ← IA32_STAR[63:48];</span><br><span class="line">&#125;</span><br><span class="line">CS.Selector ← CS.Selector OR 3; (* RPL forced to 3 *)</span><br><span class="line">SS.Selector ← (IA32_STAR[63:48]+8) OR 3;</span><br></pre></td></tr></table></figure>

<h3 id="Syscall-win10x64-下执行流程"><a href="#Syscall-win10x64-下执行流程" class="headerlink" title="Syscall win10x64 下执行流程"></a>Syscall win10x64 下执行流程</h3><p>系统调用主要是靠维护Trap_Farmer结构体.</p>
<h4 id="关键部分代码"><a href="#关键部分代码" class="headerlink" title="关键部分代码"></a>关键部分代码</h4><p>快速调用 由于指令不会把cs ss压栈    由函数KiSystemCall64  设置的  </p>
<p>初始化Trap_Farmer结构体</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/init.png"></p>
<p>获取服务号,并判断找哪张表  如果服务号大于0x1000找shadow那张表</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/GetServiceNub.png"></p>
<p>选择哪张ssdt表  分为3中一种是带图形 一种是不带图形 还有一种过滤过的表</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/ChoseSsdt.png"></p>
<p>通过ssdt表基址加上   ssdt表内的偏移表里的偏移右移4位(因为低4位是栈里的参数超过4个参数的会放到栈里)  公式     ([偏移表+服务号*4]&gt;&gt;4)+函数表首地址&#x3D;&#x3D;函数地址</p>
<img src="https://gitee.com/xiaoqian2000/pic/raw/master/ssdtFunc.png"  />

<p>拷贝函数所需要的参数   末尾sub r11,rax  是因为刚好copy一个参数字节码是8</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/copyAry.png"></p>
<p>拷贝完跳转到内核函数</p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/CallFunc.png"></p>
<p>执行完接下来有一些了检查这里就先跳过</p>
<p>返回地址放到RCX  R11放的是eflag </p>
<p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/return.png"></p>
<h3 id="win10-x64-SSDT结构介绍"><a href="#win10-x64-SSDT结构介绍" class="headerlink" title="win10 x64 SSDT结构介绍"></a>win10 x64 SSDT结构介绍</h3><p><img src="https://gitee.com/xiaoqian2000/pic/raw/master/Ssdt.png"></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">fffff806`<span class="number">730</span>dbf90  是函数表首地址     函数表表项  ([偏移表+服务号*<span class="number">4</span>]&gt;&gt;<span class="number">4</span>)+函数表首地址==函数地址    右移<span class="number">4</span>位代表栈上参数数量.</span><br><span class="line"><span class="number">00000000</span>`<span class="number">000001</span>d7  是函数表函数数量</span><br><span class="line">fffff806`<span class="number">730</span>dc6f0  是函数表末尾地址</span><br><span class="line"><span class="keyword">typedef</span> <span class="keyword">struct</span> _KeServiceDescriptorTableShadow</span><br><span class="line">&#123;</span><br><span class="line">	PVOID64 FuncTable;</span><br><span class="line">	DWORD64 Resave;</span><br><span class="line">	DWORD64 FuncNumb;</span><br><span class="line">	DWORD64 FuncTableOverAdress;</span><br><span class="line">&#125;KeServiceDescriptorTableShadow, * PKeServiceDescriptorTableShadow;</span><br><span class="line"></span><br></pre></td></tr></table></figure>


</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://xiaoqian2000.gitee.io/blogs">小乾</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://xiaoqian2000.gitee.io/blogs/2023/08/20/win10%20%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/">https://xiaoqian2000.gitee.io/blogs/2023/08/20/win10%20%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://xiaoqian2000.gitee.io/blogs" target="_blank">学海无涯苦作舟</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="/blogs/img/headpicture.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blogs/2023/08/20/Window10%20SwapContext%E5%88%86%E6%9E%90/" title="Win10 X64 1904 线程交换SwapContext分析"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Win10 X64 1904 线程交换SwapContext分析</div></div></a></div><div class="next-post pull-right"><a href="/blogs/2023/08/20/C++%E7%B1%BB%E7%9A%84%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83/" title="C++类的内存分布"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">C++类的内存分布</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/blogs/img/headpicture.png" onerror="this.onerror=null;this.src='/blogs/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">小乾</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/blogs/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blogs/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blogs/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/xiaoqian2000"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">欢迎学习和讨论</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8"><span class="toc-number">1.</span> <span class="toc-text">系统调用</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#INT2E-%E8%B0%83%E7%94%A8"><span class="toc-number">1.1.</span> <span class="toc-text">INT2E 调用</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BF%AB%E9%80%9F%E8%B0%83%E7%94%A8"><span class="toc-number">1.2.</span> <span class="toc-text">快速调用</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#sysenter"><span class="toc-number">1.2.0.1.</span> <span class="toc-text">sysenter</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#sysexit"><span class="toc-number">1.2.0.2.</span> <span class="toc-text">sysexit</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%B5%8B%E8%AF%95"><span class="toc-number">1.2.0.2.1.</span> <span class="toc-text">测试</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Syscall-64%E4%BD%8D%E7%B3%BB%E7%BB%9F"><span class="toc-number">1.2.1.</span> <span class="toc-text">Syscall   64位系统</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#sysret"><span class="toc-number">1.2.2.</span> <span class="toc-text">sysret</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Syscall-win10x64-%E4%B8%8B%E6%89%A7%E8%A1%8C%E6%B5%81%E7%A8%8B"><span class="toc-number">1.2.3.</span> <span class="toc-text">Syscall win10x64 下执行流程</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B3%E9%94%AE%E9%83%A8%E5%88%86%E4%BB%A3%E7%A0%81"><span class="toc-number">1.2.3.1.</span> <span class="toc-text">关键部分代码</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#win10-x64-SSDT%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D"><span class="toc-number">1.2.4.</span> <span class="toc-text">win10 x64 SSDT结构介绍</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/blogs/2023/08/20/Window10%20SwapContext%E5%88%86%E6%9E%90/" title="Win10 X64 1904 线程交换SwapContext分析">Win10 X64 1904 线程交换SwapContext分析</a><time datetime="2023-08-20T13:21:52.000Z" title="发表于 2023-08-20 21:21:52">2023-08-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/blogs/2023/08/20/win10%20%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/" title="Win10 X64 1904 系统调用">Win10 X64 1904 系统调用</a><time datetime="2023-08-20T13:21:52.000Z" title="发表于 2023-08-20 21:21:52">2023-08-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/blogs/2023/08/20/C++%E7%B1%BB%E7%9A%84%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83/" title="C++类的内存分布">C++类的内存分布</a><time datetime="2023-08-20T11:51:52.000Z" title="发表于 2023-08-20 19:51:52">2023-08-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/blogs/2023/08/15/decltpye%E8%AE%B2%E8%A7%A3/" title="decltpye:讲解">decltpye:讲解</a><time datetime="2023-08-14T16:03:52.000Z" title="发表于 2023-08-15 00:03:52">2023-08-15</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/blogs/2023/08/01/%E6%81%B6%E6%84%8F%E4%BB%A3%E7%A0%81%E5%AE%9E%E6%88%98%E5%88%86%E6%9E%90Lab%2010-1/" title="恶意代码实战分析10.1">恶意代码实战分析10.1</a><time datetime="2023-08-01T15:26:52.000Z" title="发表于 2023-08-01 23:26:52">2023-08-01</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By 小乾</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blogs/js/utils.js"></script><script src="/blogs/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>